#include "web_acceptor.h"

void user_handler::web_acceptor::handle_event(
	boost::shared_ptr<network::message> n)
{
	// creating the receiver and handler...
	if(n->type == network::CONNECT) {
		boost::shared_ptr<user_handler::web_handler> han(
			user_handler::web_handler::create(n->new_sock, 
				_controller, _music, _mgr));
		boost::shared_ptr<handler::multicaster> multi(_multi.lock());
		multi->add_handler(network::RECEIVE, n->new_sock, han);
		multi->add_handler(network::DELETE, n->new_sock, han);
		_mgr->add_recv(n->new_sock, 
			network::configurator::get_web_filetype());
	}
}

